package top.xzxsrq.fileviewutils.service;

import org.springframework.web.multipart.MultipartFile;
import top.xzxsrq.fileviewutils.entity.ShareFile;
import top.xzxsrq.fileviewutils.entity.ShareFileSearch;
import top.xzxsrq.fileviewutils.entity.ShareFileWithUser;
import top.xzxsrq.web.utils.AjaxResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface FileService {
    AjaxResult getFileList(String basePath);

    void getFileRange(HttpServletRequest request, HttpServletResponse response) throws IOException;

    AjaxResult getTextFile(String filePath) throws IOException;

    AjaxResult saveTextFile(String filePath, String content) throws IOException;

    AjaxResult deleteFileOrDir(List<String> filePaths) throws IOException;

    AjaxResult copyFileOrDir(List<String> filePaths, String targetPath) throws  IOException;

    AjaxResult removeFileOrDir(List<String> filePath, String targetPath) throws IOException;

    AjaxResult uploaderFile(String basePath, MultipartFile file) throws IOException;

    AjaxResult shareFileOrDir(List<ShareFile> shareFiles) throws IOException;

    AjaxResult shareFileList(ShareFileSearch shareFile, int pageNum, int pageSize);

    AjaxResult shareFileDelete(List<String> shareFileDelete);

    AjaxResult shareFileUpdate(ShareFile shareFile);

    AjaxResult hasFile(String basePath) throws IOException;

    AjaxResult getFileInfo(String basePath) throws IOException;

    AjaxResult createFile(String basePath) throws IOException;

    AjaxResult createDir(String basePath) throws IOException;

    AjaxResult downloadFileOrDir(String basePath, List<String> filePaths) throws IOException;

    void downloadFileOrDirById(String downLoadId, HttpServletRequest request, HttpServletResponse response) throws IOException;

    AjaxResult getDiskInfo();

    AjaxResult getShareFile(String id);

    AjaxResult shareFileDown(ShareFileWithUser shareFileWithUser) throws IOException;

    AjaxResult rename(String filePath, String newName) throws IOException;

    void getFile(HttpServletRequest request, HttpServletResponse response) throws IOException;

    AjaxResult getDirFileList(String basePath);

    void getFileIcon(HttpServletRequest request, HttpServletResponse response) throws IOException;
}
